{include file='common/head'}
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">

    <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;">
        <legend>收入明细</legend>
        <blockquote class="layui-elem-quote layui-text">
            <div class="demoTable layui-form">
                <!--<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>-->
                <div class="demoTable layui-form">
                    <div class="layui-input-inline">
                        <input type="text" name="date" placeholder="请输入创建时间" id="date1" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                    </div>
                    <button class="layui-btn " data-type="reload" ><i class="layui-icon">&#xe615;</i>搜索</button>
                </div>
            </div>
        </blockquote>
        <div class="demoTable layui-for">
            <table class="layui-table" lay-data="{height: 'full-150',width:'200px',url:'{$url1}',edit:true, page:true, id:'testReload',loading:true}" lay-filter="demo">
                <thead>
                <tr>
                    <th lay-data="{field:'id',width:180,fixed: true}">编号</th>
                    <th lay-data="{field:'get_price', width:120}">收入金额</th>
                    <th lay-data="{field:'cl_id', width:220}">收入课程</th>
                    <th lay-data="{field:'created_at',width:200}">收入时间</th>
                </tr>
                </thead>
            </table>
        </div>
    </fieldset>
    <br>
    <br>
    <br>
    <br>
    <br>
    <fieldset class="layui-elem-field site-demo-button">
        <legend>提现记录</legend>
        <blockquote class="layui-elem-quote layui-text">
            <div class="demoTable layui-form">
                <!--<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>-->
                <div class="demoTable layui-form">
                    <div class="layui-input-inline">
                        <input type="text" name="date" placeholder="请输入创建时间" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                    </div>
                    <button class="layui-btn " data-type="reload" ><i class="layui-icon">&#xe615;</i>搜索</button>
                </div>
            </div>
        </blockquote>
        <div class="demoTable layui-for">
            <table class="layui-table" lay-data="{height: 'full-150',width:'200px',url:'{$url}',edit:true, page:true, id:'testReload',loading:true}" lay-filter="demo">
                <thead>
                <tr>
                    <th lay-data="{field:'ui_id',width:180,fixed: true}">编号</th>
                    <th lay-data="{field:'get_price', width:120}">提现金额</th>
                    <th lay-data="{field:'status', width:120,templet:'#status'}">提现状态</th>
                    <th lay-data="{field:'created_at',width:200}">创建时间</th>
                    <th lay-data="{field:'admin_name',width:150}">操作人</th>
                    <th lay-data="{field:'change_time',width:200}">操作时间</th>
                    <th lay-data="{field:'trans_number',width:200}">交易号</th>
                </tr>
                </thead>
            </table>
            <script type="text/html" id="status">
                {{#  if(d.status == 1){ }}
                <span style="color: #FF5722" >提现中 </span>
                {{#  } }}
                {{#  if(d.status == 2){ }}
                <span style="color: #5FB878" >提现完成</span>
                {{#  } }}
            </script>
        </div>
    </fieldset>
</div>
{include file='common/footer'}
<script>
    layui.use(['table','form','element','laydate'], function(){
        var table = layui.table
            ,form = layui.form
            ,element = layui.element
            ,laydate = layui.laydate;
        var $ = layui.$, active = {
            reload: function(){
                var user_name = $('input[name="user_name"]').val();
                var mobile = $('input[name="mobile"]').val();
                //执行重载
                table.reload('testReload', {
                    where: {
                        user_name:user_name,
                        mobile:mobile
                    }
                });
            }
        };

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

        //监听表格复选框选择
        table.on('checkbox(demo)', function(obj){
            console.log(obj)
        });
        //监听工具条
        table.on('tool(demo)', function(obj){
            var data = obj.data;
            var event=obj.event;
            switch(event){
                case 'info':
                    layer.open({
                        type: 2,
                        title: '查看详情',
                        shadeClose: true,
                        shade: false,
                        maxmin: true, //开启最大化最小化按钮
                        area: ['100%', '100%'],
                        content: '{:url("User/info")}?ui_id='+data.ui_id,
                        end: function () {
                            table.reload('tableId');
                        },
                    });
                    break;
                case 'delete':
                    layer.confirm('确定删除么?', function(index){
                        $.ajax({
                            url:'{:url("admin/Admin/deleteAdmin")}',
                            type:'post',
                            dataType:'json',
                            data: {'id':data.id},
                            success:function(val){
                                if(val.code == 200){
                                    obj.del();
                                    layer.msg(val.msg);
                                }
                                if(val.code == 400){
                                    layer.msg(val.msg);
                                }
                            }
                        });
                    });
                    break;
            }
        });
    });
</script>
</body>
</html>